package com.ht.persist.example.service;

import com.google.inject.persist.Transactional;

import javax.inject.Inject;
import javax.persistence.EntityManager;

public class MyService {
    @Inject
    private EntityManager em;

    @Transactional
    public void createNewPerson() {
        //em.persist(new Todo());
        //em.persist(new Person(...));
//        JPAQuery query = new JPAQuery(em);
//        QPerson women = new QPerson("women");
//        query.from(men, women).where(
//                men.gender.eq(Gender.MALE),
//                men.relationshipStatus.eq(RelationshipStatus.SINGLE),
//                women.gender.eq(Gender.FEMALE),
//                women.relationshipStatus.eq(RelationshipStatus.SINGLE));
    }
}